const { createApp } = Vue

createApp({
    data() {
        return {
            user: {
                id: '10001',
                name: '张三',
                avatar: 'https://example.com/avatar.jpg'
            },
            stats: {
                totalConsultations: 8,
                upcomingAppointments: 2
            },
            recentAppointments: [
                {
                    id: 1,
                    therapistName: '王医生',
                    date: '2024-01-20',
                    time: '14:00-15:00',
                    status: 'pending',
                    statusText: '待进行'
                },
                {
                    id: 2,
                    therapistName: '李医生',
                    date: '2024-01-18',
                    time: '10:00-11:00',
                    status: 'completed',
                    statusText: '已完成'
                }
            ]
        }
    },
    methods: {
        goToPage(page) {
            switch (page) {
                case 'index':
                    window.location.href = 'index.html';
                    break;
                case 'consultation':
                    window.location.href = 'consultation.html';
                    break;
                case 'therapist':
                    window.location.href = 'therapist.html';
                    break;
                case 'about':
                    window.location.href = 'about.html';
                    break;
                case 'user-center':
                    window.location.href = 'user-center.html';
                    break;
            }
        },
        goToAppointments() {
            // 跳转到预约管理页面
            console.log('跳转到预约管理');
        },
        goToRecords() {
            // 跳转到咨询记录页面
            console.log('跳转到咨询记录');
        },
        goToProfile() {
            // 跳转到个人资料页面
            console.log('跳转到个人资料');
        },
        goToSettings() {
            // 跳转到账号设置页面
            console.log('跳转到账号设置');
        },
        cancelAppointment(appointment) {
            if (confirm(`确定要取消与${appointment.therapistName}的预约吗？`)) {
                // 这里添加取消预约的逻辑
                console.log('取消预约：', appointment);
                alert('预约已取消');
            }
        }
    }
}).mount('#app') 